package chapter67;

class Person {
	String name = "张三"; // 姓名

	public Person() {
		System.out.println("execute Person()");
	}

	public Person(String name) {
		this.name = name;
		System.out.println("execute Person(name)");
	}
}

class Student extends Person {
	String school = "北大青鸟";

	public Student() {
		System.out.println("execute Student()");
	}

	public Student(String name, String school) {
		super(name);
		this.school = school;
		System.out.println("execute Student(name, school)");
	}
}

class PostGraduate extends Student {
	String guide;

	public PostGraduate() {
		System.out.println("execute PostGraduate()");
	}

	public PostGraduate(String name, String school, String guide) {
		super(name, school);
		this.guide = guide;
		System.out.println("execute PostGraduate(name, school, guide)");
	}
}

public class TestInherit {
	public static void main(String[] args) {
		PostGraduate pgd = new PostGraduate();
		System.out.println();
		pgd = new PostGraduate("王五", "北京大学", "李老师");
	}
}
